home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / tls / tls074c.sunsparc.Z / tls074c.sunsparc / lib / vtcl / tests / shelp.tcl < prev    next >
Encoding:
Text File  |  1995-07-20  |  1.2 KB  |  56 lines

  1. # CVS $Id: shelp.tcl,v 1.3 1995/02/03 16:55:21 zibi Exp $
  2. #
  3. # Script to test the various options of the object class
  4. #
  5.  
  6. source tools.tcl
  7.  
  8. proc shortCB  {target cbs} {
  9.  
  10.     set str [keylget cbs helpString]
  11.  
  12.     if {$str != ""} {
  13.     VtSetValues $target -label $str
  14.     } else {
  15.     VtSetValues $target -label "Short Help"
  16.     }
  17. }
  18.  
  19. proc createObjects {parent shortLabel} {
  20.  
  21.     set butLabels { "Button 1" "Button 2" "Button 3" }
  22.     foreach but $butLabels {
  23.     VtPushButton $parent.$but \
  24.         -shortHelpString "Short Help for $but" \
  25.         -shortHelpCallback "shortCB $shortLabel"
  26.     }
  27.  
  28.     VtPushButton $parent.exit -label Exit -callback QuitCB \
  29.     -shortHelpString "Exits this script" \
  30.     -shortHelpCallback "shortCB $shortLabel"
  31.  
  32. }
  33.  
  34. set ap [VtOpen ObjectTest]
  35.  
  36. set dlog [VtFormDialog $ap.dlog ]
  37.  
  38. set rc [VtRowColumn $dlog.rc -topSide FORM -leftSide FORM -rightSide FORM]
  39.  
  40. set sep [VtSeparator $dlog.sep -below $rc -leftSide FORM -rightSide FORM]
  41.  
  42. set shortLabel [VtLabel $dlog.shortLab -label "Short Help"\
  43.      -topSide NONE -bottomSide FORM -leftSide FORM -rightSide FORM\
  44.      -bottomOffset 2]
  45.  
  46. VtSetValues $rc -bottomSide $sep 
  47. VtSetValues $sep -bottomSide $shortLabel -topSide NONE
  48.  
  49. createObjects $rc $shortLabel
  50.  
  51.  
  52. VtShow $dlog
  53.  
  54. VtMainLoop
  55.  
  56.